/*
day63
2019.10.30
*/
#include<map>
using namespace std;

struct TreeNode 
{
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
};


class Solution {
public:
	bool preOrder(TreeNode *root,map<int,int> &m,int k)
	{
		if(!root) return false;
	
		if(m[k-root->val]) return true;
		m[root->val]=1;
		
		return preOrder(root->left,m,k)||preOrder(root->right,m,k);
	}
	
    bool findTarget(TreeNode* root, int k) 
	{
        map<int,int> m;
        return preOrder(root,m,k);
    }
};


int main()
{
	return 0;
}
